package src.elevent;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Example_04 {

    private FileReader reader = null;
    public void createFile() throws FileNotFoundException {
        reader = new FileReader("src/elevent/Example_03.java");
    }

    public void test(){
        try {
            createFile();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.out.println("创建IO对象异常。");
        }finally {
            if(reader != null){
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                    System.out.println("关闭异常");
                }
            }
        }
    }

    public static void main(String[] args) {
        Example_04 example04 = new Example_04();
        example04.test();
    }

}
